<title>树形结构的二维数组转树形结构，无限分类菜单</title>
欢迎光临程序员学习笔记：<a href='http://www.cnblogs.com/codeaaa'>http://www.cnblogs.com/codeaaa</a>
<div id='menu'></div>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script>
function bq(url,command,callback=false) {
  $.ajax({
    async: true,
    url: url,
    type: 'POST',
    data: JSON.stringify(command), // JSON.stringify(command),
    dataType: "json",
    contentType: 'application/json',
    success: function(msg) {
	  if(callback) callback(msg);
    },
    error: function(a, b) {
      console.log(a,b);
    }
  });
}
url = 'http://api.xngqt.com.cn/addrlist/q.php';
data = {
  cmd:2,
  val:{
    token: 'wh8EXQx7UkWdUFdz7ezmxnksnAsaQCkOKz131rc7CwF8JpURxwn1Fr5HSrPCdJYDgXnSZL/Lq1xIBpRAR4MY2nBN1Yg/S/shZyeOzJIToPc=',
    table: 'users',
    username: 'abcdefg',
    password: '123',
    name: '张三',
    tel: '13333333333',
    other: {img:'http://sdfds.com/sdfsd.jgp'},
    post: '老板',
    path: 1
  }
};
data ={
  cmd:0,
  val:{
    token: 'wh8EXQx7UkWdUFdz7ezmxnksnAsaQCkOKz131rc7CwF8JpURxwn1Fr5HSrPCdJYDgXnSZL/Lq1xIBpRAR4MY2nBN1Yg/S/shZyeOzJIToPc=',
    table: 'users',
    id:1
  }
}

function aaa(a){
console.log(a);
}
bq(url,data,aaa);
</script>


